package com.ruoyi.web.core.config;

import com.github.wxpay.sdk.WXPayConfig;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;

/**
 * 众燊商户号配置类
 */
@Slf4j
public class ZhongshenConfig extends WechatConfig {
    /**
     * 天蛙小程序appId
     */
    public static final String APPID = "wxd602e0793295cc28";

    /**
     * 天蛙小程序密钥
     */
    public static final String SECRET = "7ec0b59e73b75b7388bd0323f1d29955";

    /**
     * 众燊商户号
     */
    public static final String MCHID = "1610622133";

    /**
     * 众燊商户密钥 --- 同 API V3 密钥
     */
    public static final String KEY = "9845d3f51aeb4574cbce4117289866ef";

    /**
     * 众燊 API V3 秘钥
     */
    public static final String API_V3_KEY = "9845d3f51aeb4574cbce4117289866ef";


    public static final String BODY = "智能物联";

    public static final  String DESC = "智能物联分润到账";

    /**
     * 众燊支付分充电宝服务号
     */
    public static final String SERVICE_ID = "00002000000000162373210351723966";

    /**
     * 支付分签名方式
     */
    public static final String SIGN_TYPE = "HMAC-SHA256";

    /**
     * 金额环回说明
     */
    public static final String REFUND_DESC = "智能物联，余额退还";

    /**
     * 众燊商户api证书序列号
     * https://myssl.com/cert_decode.html 证书解析地址
     */
    public static final String SERIAL_NO = "1569CAC94D9435AC187E2B3EC5606DCB5387CA21";

    /**
     * 众燊证书内容  apiclient_key.pem文件中的内容 除去开头结尾行
     *  请求量大为节约资源直接拿出来
     */
    public static final String PRIVATE_CONTENT = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQChvEV+BgWJ4McX" +
            "Xe7ACR6tS0iZHb85vsNX/qT6dbnOO53C9ScZtnjfsTF87Z13rxUd9N2726IicOYr" +
            "5zR0iW5T4smmhC0mwmGHxkGBgeaKfsVK4JkVxMmeh8UJOwgco/RQgX1wsjSbCqAK" +
            "b6rpwlfA6AsFBBH0q73OqYxp9sPV9TAURlwajapVMAxRZYr5M4Z9X312BRgjMnNT" +
            "s3aCnwF+/lWVxzw9zUz4PtA8RSkHMicHq2L9FzBpE7PwvSm42+eK3mTh6g1k1WOZ" +
            "XdKvEKgBYsQSW4uUv9vzt38mYDsQ2eRdiKLE7IxBXoRI2TRMzDVMxOSO7RDpNXuo" +
            "7HscxBhbAgMBAAECggEAYvaVuwAqQWyVxfmHDmBGMhlfqbkm+kl8tAovnsWMVOHr" +
            "rZBeRYB+w7ljo6KteL9b94GOb9V7hwF4BaMqWKiDJrcdVlOIYTANh4vLJ1h53YKm" +
            "bCOz6DsKd4NyECzb0NKNuvkQ7XVNdRTySpB7jx+InJQfsgkEh6bStHLQZUJGIFM2" +
            "pzK84wvA2wKMrOR2OPkl+COpo8QXBFIMXXHQ7gUeReE5p1xER3ycLK4C+fxQmCVr" +
            "mpKJYxOZbouA+LTDinOMiMs9Rh2PJsfDKHaT7Dls23obRMO4t6tMIC52xwFwCFj+" +
            "qTABJ5dDoEZSIKRKCihv+eglZO4MPNC9vn/IKlxY+QKBgQDWT8vbuy/JzNGEe5MP" +
            "WwBddpv4yRfh2Yv6EBo4bohBOVYYz0xeWWRnYichB0Gp2E4ya8CjZBb86SxpURvF" +
            "GSvY1FB4MJ+D3d5M6EEHkHIYUCfw8tGM+TYIH9TqcVLhZZfkFzsf8H40PdD7sK3R" +
            "ytPFkzmcD2wjKqnlcJ/GODMJrwKBgQDBMk3nMvZ1dri8oiz8hl9yE0juFVl3BIMv" +
            "g6qDz4aTXIvtiOuyoVdmmKa5TM31N9pzlaDCb0ATNYM1RkbmZNjP8C7hhLuUzivq" +
            "Z8n1ym0xuOJgriEkgzc4qhYHYl+F+Xdww4mZr8qQX6wvt+Aj2Nh794ScMLRecjuE" +
            "P21UlAzDFQKBgHRkaBoRQnX91/h0yLy5NqyMA0+Nn3vYk84euq7VUQjjY+AbjaVc" +
            "NUx0oT2t3DqrMGTv4nKapGV9GdKk60kTT532STHNboTGlbn9FXxPNbgAqICSz74Z" +
            "hv/IkfE11MZ3T5PgDgtdqJ0kyYA4R16+Il+Wgt4//gHnZNgoX43e7dEfAoGAH1qW" +
            "ogr3TKDz4kk/m8wC+XR/xYPZfSNSVwe7SKEJaij+3JH4Dol4scHcbP41/rIN1exW" +
            "prd/Yp6wqJi7MPD07uo/8YGlH8VGA0jM0gMELamfs6kO3+obsCqKYLBqaEfQRpC1" +
            "aCfLbBrayvPAgJDUsWm+L8sHurw3RIM2rx9H4vECgYB42jH4NCggQzpZ/usXHGYI" +
            "9kFtqqjZnIvbAHpBYhQgMsKW8cxByMtLCNFx39zPHYvdgZvDTOJIEAxHhjg66bUF" +
            "d/X9hWByJNkjmUYerow0LFvcpXtWXhutCeFtINrvlmCeclxOq/hWsMD2pi+wfdgr" +
            "C7+CHvpXgZWAZz58rgopDg==";

    @Override
    public String getAppid() {
        return APPID;
    }

    @Override
    public String getSecret() {
        return SECRET;
    }

    @Override
    public String getMchId() {
        return MCHID;
    }

    @Override
    public String getKey() {
        return KEY;
    }

    @Override
    public String getApiV3Key() {
        return API_V3_KEY;
    }

    @Override
    public String getBody() {
        return BODY;
    }

    @Override
    public String getDesc() {
        return DESC;
    }

    @Override
    public String getServiceId() {
        return SERVICE_ID;
    }

    @Override
    public String getSignType() {
        return SIGN_TYPE;
    }

    @Override
    public String getRefundDesc() {
        return REFUND_DESC;
    }

    @Override
    public String getSerialNo() {
        return SERIAL_NO;
    }

    @Override
    public String getPrivateContent() {
        return PRIVATE_CONTENT;
    }

    @Override
    public WXPayConfig getWXPayConfig() {
        try {
            return new ZhongshenPayConfig();
        } catch (IOException e) {
            log.error("【error】：众燊商户配置文件初始化失败" +e.getMessage(), e);
        }
        return null;
    }
}
